<?php
$doc = $this->getContractDoc($this->houseId);
?>
<div class="popform">
    <p class="validateTips"></p>
    <form id="contract_form" action="myhouses/contract" name="contract_form" method="POST" enctype="multipart/form-data">
        <ul class="fl">
            <li class="top">
                <label>Title:<span>*</span></label>
                <div class="inputbg"><?php echo $this->form->name; ?></div>
                <div class="clr"></div>
            </li>
            <li>
                <label>Document:<span>*</span></label>
                <div class="inputbg"><?php echo $this->form->doc_path; ?></div>
                <div class="clr"></div>
            </li>
            <input type="hidden" name="houseId" value="<?= $this->houseId; ?>">
            <?php if (!empty($doc)) { ?>
                <input type="hidden" name="docId" value="<?= $doc['id']; ?>">
            <?php } ?>
        </ul>
    </form>
</div>
<div class="clr"></div>
<div class="popform">
    <?php
    if (!empty($doc)) {

        $user = $this->getUserDetail($doc['uploader_id']);
        ?>
        <p><strong>Contract:</strong></p>
        <div class="popup-filelist">

            <ul>
                <li style="list-style: disc inside none"> 
                    <a href="<?= $this->baseURI(); ?>marketing/document/download/<?= $doc['file']; ?>"><?= $doc['name']; ?></a>
                    by <?=$user['fname'].' '.$user['lname'];?> at <?=$doc['date'];?>
                </li>
            </ul>

        </div>
    <?php } ?>
</div>